package net.letcode.core.utils.api;

/**
 * 系统请求状态码
 */
public enum StatusCode {
    Success(0, "请求成功"),
    Busy(-1, "系统繁忙"),

    ////////////  系统级错误以11开头的6位数字 ////////////
    ParameterError(110001, "参数错误"),
    NoPermission(110002, "没有权限访问"),
    VerifyCodeError(110003, "验证码错误"),
    ServerError(110004, "服务器端异常"),

    //////////// 通用表单类错误以12开头的6位数字 ////////////
    FormIdError(120001, "ID不可用"),
    FormCodeError(120002, "代码不可用"),
    FormTypeError(120003, "类型不可用"),
    FormParentError(120004, "上级不可用"),
    FormCategoryError(120005, "分类不可用"),
    FormTitleError(120006, "名称不可用"),
    FormStatusError(120007, "状态不可用"),

    ////////////  用户类错误以13开头的6位数字 ////////////
    NoLogin(130001, "用户未登录"),
    AccountDisabled(130002, "账户不可用"),
    UsernameError(130003, "用户名错误"),
    PasswordError(130004, "密码错误"),
    UsernameDisabled(130005, "用户名不可用");



    private int code;
    private String text;
    StatusCode(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    @Override
    public String toString() {
        return "StatusCode{" +
                "code=" + code +
                ", text='" + text + '\'' +
                '}';
    }
}
